import request from '../utils/request'

const WEB_APP = 'http://localhost:8080';

export function queryList() {
  return request(`${WEB_APP}/group/`);
}

export function deleteOne(id) {
  return request(`${WEB_APP}/group/delete/${id}`, {
    method: 'GET'
  });
}

export function addOne(data) {
  return request(`${WEB_APP}/group/add`, {
    headers: {
      'content-type': 'application/json',
    },
    method: 'POST',
    body: JSON.stringify(data),
  });
}

export function updateOne(data) {
  return request(`${WEB_APP}/group/update`, {
    headers: {
      'content-type': 'application/json',
    },
    method: 'POST',
    body: JSON.stringify(data),
  });
}
